<template>
  <div class="page">
    <div>
        <a :href="successUrl" target="_blank">模拟SCNet点击进入【成功】</a>
    </div>
    <div>
        <a :href="errorUrl" target="_blank">模拟SCNet点击进入【失败】</a>
    </div>
  </div>
</template>

<script setup lang="ts">
import { base58Encode } from '@/utils/base58';

const accountInfo = {
    "token":"01fc7e67-23b0-4663-87ac-fc4568c4cfc1",
    "userId":1,
    "nickname":"13581696593",
    "username":"acqs3381fh_2kljjl3fd",
    "email":"aaa@aaa.aaa",
    "phone":"1",
    "status":1
};

const errorInfo = {
    "status":0,
    "errorCode":"20000",
    "errorMsg":"token失效，请重新从scent跳转"
};

const successToken = base58Encode(JSON.stringify(accountInfo));
const errorToken = base58Encode(JSON.stringify(errorInfo));

const getUrl = (token) => {
  let t = window.location;
  return `${t.protocol}//${t.host}/?localToken=${token}#/home`;
}
const successUrl = getUrl(successToken);
const errorUrl = getUrl(errorToken);
</script>

<style lang="less" scoped>

</style>
